#include "info.h"
#include "ui_info.h"
#include <QDebug>
#include <qgraphicseffect.h>
#include <QPushButton>

QWidget *widget;
Info::Info(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Info)
{
    ui->setupUi(this);

    ui->buttonBox->button(QDialogButtonBox::Ok)->setText("确定");
    ui->buttonBox->button(QDialogButtonBox::Cancel)->setText("取消");

    //无标题栏,使圆角会透明
    this->setWindowFlags(windowFlags() | Qt::FramelessWindowHint);
    setAttribute(Qt::WA_TranslucentBackground);

    //父窗口灰色遮罩
    widget = new QWidget(parent,Qt::FramelessWindowHint);
    widget->resize(parent->size());
    widget->setObjectName("widget_parent");// 设置对象句,相当于css里的id
    widget->setStyleSheet("#widget_parent {background-color:rgba(10, 10, 10,120);}"); // 设置id对应元素的背景色
    widget->show();
}

Info::~Info()
{
    delete widget;
    delete ui;
}

void Info::on_checkBox_del_stateChanged(int arg1)
{
    if(arg1 == 2)
        ui->checkBox_del->setStyleSheet("color:red; font:bold");
    else
        ui->checkBox_del->setStyleSheet("color:black; font:normal");
}
